<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2018/9/25 0025
  Time: 下午 9:00
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<html>
<head>
    <title>订单</title>
    <script src="../../js/jquery-3.3.1.min.js" charset="utf-8"></script>
    <script src="../../js/cookie/jquery.cookie.js" charset="utf-8"></script>
    <script src="../../layui-v2.2.5/layui/layui.js" charset="utf-8"></script>
    <link rel="stylesheet" href="../../layui-v2.2.5/layui/css/layui.css" media="all">
</head>
<body>


<table class="layui-hide" id="test" lay-filter="test"></table>


<script src="//res.layui.com/layui/dist/layui.js" charset="utf-8"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
<script>
    layui.use('table', function(){
        var table = layui.table;
        table.render({
            elem: '#test'
            ,url:'/test/table/demo3.json'
            ,toolbar: true
            ,title: '用户数据表'
            ,totalRow: true
            ,cols: [[
                {field:'id', title:'订单ID', width:200, fixed: 'left', totalRowText: '合计行'}
                ,{field:'money', title:'订单金额', width:200, edit: 'text'}
                ,{field:'memberName', title:'用户名', width:200, edit: 'text'}
                ,{field:'createTime', title:'下单时间', width:200, }
                ,{field:'state', title:'订单状态', width:200, edit: 'text', }

            ]]
            ,page: true
            ,response: {
                statusCode: 200 //重新规定成功的状态码为 200，table 组件默认为 0
            }
            ,parseData: function(res){ //将原始数据解析成 table 组件所规定的数据
                return {
                    "code": res.status, //解析接口状态
                    "msg": res.message, //解析提示文本
                    "count": res.total, //解析数据长度
                    "data": res.rows.item //解析数据列表
                };
            }
        });
    });
</script>
</body>
</html>
